package cn.ad.server.persistence.dao;

import java.util.List;

import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import cn.ad.server.domain.ad.platform.MapperPlatformIndustry;

@Component
public interface PlatformIndustryDao {
		@Results(value = { @Result(column = "id", property = "id", id = true),
			@Result(column = "platform_id", property = "platformId"),
			@Result(column = "industry_id", property = "industryId"),
			@Result(column = "platform_industry_id", property = "platformIndustryId"),
			@Result(column = "parent_id", property = "parentId"),
			@Result(column = "name", property = "name"),
			@Result(column = "update_time", property = "updateTime"),
			@Result(column = "create_time", property = "createTime"),
			@Result(column = "status", property = "status") })
		@Select("select * from platform_industry_map ")
		/**
		 * 获取所有平台行业映射关系
		 * @return
		 */
		public List<MapperPlatformIndustry> findAll();
		
		
		@Results(value = { @Result(column = "id", property = "id", id = true),
				@Result(column = "platform_id", property = "platformId"),
				@Result(column = "industry_id", property = "industryId"),
				@Result(column = "platform_industry_id", property = "platformIndustryId"),
				@Result(column = "update_time", property = "updateTime"),
				@Result(column = "create_time", property = "createTime"),
				@Result(column = "status", property = "status") })
		@Select("select * from platform_industry_map where id = #{value}")
		/**
		 * 根据ID获取一个对应的平台行业映射关系
		 * @param id
		 * @return
		 */
		public MapperPlatformIndustry findById(long id);
		
	
}
